package com.konne.nightmare.FastPublicOpinion.ui.personal.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.konne.nightmare.FastPublicOpinion.R;
import com.konne.nightmare.FastPublicOpinion.base.BaseMvpActivity;
import com.konne.nightmare.FastPublicOpinion.base.BaseMvpPresenter;
import com.konne.nightmare.FastPublicOpinion.utils.LoadProgressDialog;
import com.konne.nightmare.FastPublicOpinion.utils.StringUtils;
import com.konne.nightmare.FastPublicOpinion.utils.ToastUtil;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * @Author: chen
 * @UpdateDate: 1/23/22
 * @UpdateRemark:
 */
public class BindingMailActivity extends BaseMvpActivity implements View.OnClickListener{

    @BindView(R.id.tv_title)
    TextView tvTitle;
    @BindView(R.id.img_back)
    ImageView imgBack;
    @BindView(R.id.img_right)
    ImageView imgRight;
    @BindView(R.id.rl_root)
    RelativeLayout rlRoot;
    @BindView(R.id.tv_binding)
    TextView tvBindingPhone;
    @BindView(R.id.img_delete)
    ImageView imgDelete;
    @BindView(R.id.edit_phone)
    EditText editPhone;
    @Override
    protected BaseMvpPresenter createPresenter() {
        return new BaseMvpPresenter();
    }

    @Override
    public int getLayout() {
        return R.layout.activity_binding_mail;
    }

    @Override
    public void initView() {
        initImmersionBar(R.color.color_3396FE,false);
        rlRoot.setBackgroundColor(getResources().getColor(R.color.color_3396FE));
        tvTitle.setText("邮箱");
        tvTitle.setTextColor(getResources().getColor(R.color.white));
        imgRight.setVisibility(View.VISIBLE);
        imgRight.setImageResource(R.mipmap.icon_close_white);
        imgBack.setImageResource(R.mipmap.icon_arrow_left_white);

    }

    @Override
    public void initData(Bundle savedInstanceState) {

    }
    @OnClick({R.id.img_back,R.id.img_right,R.id.tv_binding,R.id.img_delete})
    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.img_back:
            case R.id.img_right:
                finish();
                break;
            case R.id.tv_binding_phone:
                ToastUtil.showToast("绑定成功");
                finish();
                break;
            case R.id.img_delete:
                editPhone.setText("");
                break;

        }
    }
    @Override
    public LoadProgressDialog getLoadDialog() {
        return dialog;
    }

    @Override
    public void cancelLoadDialog() {
        if (dialog != null && dialog.isShowing()) {
            dialog.cancel();
        }
    }
}